import QtQuick 2.0
import QtQuick.Controls 2.5

Item {
    width: 850
    height: 580

    signal qmlSN_sqlWriteFinish()
    onQmlSN_sqlWriteFinish: {
        var t_dataValueOf = new Date().valueOf()
        page_7AnalogMonitorAChannel.addLinePoint(
                    t_dataValueOf,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("A套机端电压")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("A套机端电流")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("A套励磁电流")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("A套同步电压")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("A套自动给定")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("A套手动给定")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("A套控制信号")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("A套有功功率")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("A套无功功率")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("A套电压频率")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("A套系统电压")*0.01,
                    )

        page_7AnalogMonitorBChannel.addLinePoint(
                    t_dataValueOf,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("B套机端电压")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("B套机端电流")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("B套励磁电流")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("B套同步电压")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("B套自动给定")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("B套手动给定")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("B套控制信号")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("B套有功功率")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("B套无功功率")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("B套电压频率")*0.01,
                    $sqlMcRecorder.qml_getRecordVal_bystr_toint16("B套系统电压")*0.01,
                    )
    }
    Component.onCompleted: {

    }

    SwipeView{
        id:swipeView_this
        orientation: Qt.Horizontal
        clip: true
        currentIndex: 0
        width: parent.width
        height: parent.height*0.85
        interactive: false

        Item {
            id: firstPage
            Page_07AnalogMonitorAChannel {
                id: page_7AnalogMonitorAChannel
                width: swipeView_this.width
                height: swipeView_this.height
            }
        }
        Item {
            id: secondPage
            Page_07AnalogMonitorAChannel {
                id: page_7AnalogMonitorBChannel
                width: swipeView_this.width
                height: swipeView_this.height
            }
        }
        Item {
            id: thirdPage
            Item {
                id: name1
                Text {
                    id: name11
                    text: qsTr("text")
                }
            }

        }
        Item {
            id: fourthPage
            Item {
                id: name2
                Text {
                    id: name22
                    text: qsTr("text")
                }
            }
        }

        onCurrentIndexChanged: {
            switch(swipeView_this.currentIndex)
            {
            case 0:
                button.checked = true
                button2.checked = false
                button3.checked = false
                button4.checked = false
                break;
            case 1:
                button.checked = false
                button2.checked = true
                button3.checked = false
                button4.checked = false
                break;
            case 2:
                button.checked = false
                button2.checked = false
                button3.checked = true
                button4.checked = false
                break;
            case 3:
                button.checked = false
                button2.checked = false
                button3.checked = false
                button4.checked = true
                break;
            }
        }
    }

    EXC_Normal_BtnSytle {
        id: button
        nameText: qsTr("A通道模拟量")
        width: parent.width*0.21
        height: parent.height*0.09
        checked: true
        anchors.left: parent.left
        anchors.leftMargin: parent.width*0.05
        anchors.topMargin: parent.height*0.02
        anchors.top: swipeView_this.bottom
        onClicked: {
            if(swipeView_this.currentIndex==0)
                checked = true;
            else
                swipeView_this.currentIndex = 0
        }
    }

    EXC_Normal_BtnSytle {
        id: button2
        nameText: qsTr("B通道模拟量")
        width: parent.width*0.21
        height: parent.height*0.09
        anchors.left: parent.left
        anchors.leftMargin: parent.width*0.28
        anchors.topMargin: parent.height*0.02
        anchors.top: swipeView_this.bottom
        onClicked: {
            if(swipeView_this.currentIndex==1)
                checked = true;
            else
                swipeView_this.currentIndex = 1
        }
    }

    EXC_Normal_BtnSytle {
        id: button3
        nameText: qsTr("录波曲线")
        width: parent.width*0.21
        height: parent.height*0.09
        anchors.left: parent.left
        anchors.leftMargin: parent.width*0.51
        anchors.topMargin: parent.height*0.02
        anchors.top: swipeView_this.bottom
        onClicked: {
            if(swipeView_this.currentIndex==2)
                checked = true;
            else
                swipeView_this.currentIndex = 2
        }
    }
    EXC_Normal_BtnSytle {
        id: button4
        nameText: qsTr("录波数据")
        width: parent.width*0.21
        height: parent.height*0.09
        anchors.left: parent.left
        anchors.leftMargin: parent.width*0.74
        anchors.topMargin: parent.height*0.02
        anchors.top: swipeView_this.bottom
        onClicked: {
            if(swipeView_this.currentIndex==3)
                checked = true;
            else
                swipeView_this.currentIndex = 3
        }
    }
}

/*##^##
Designer {
    D{i:0;formeditorZoom:0.5}
}
##^##*/
